- Title
- CodeKernel: A Graph Kernel Based Approach to the Selection of API Usage Examples
- Creator
- Gu, Xiaodong; Zhang, Hongyu; Kim, Sunghun
- Relation
- 2019 34th IEEE/ACM International Conference on Automated Software Engineering (ASE 2019). Proceedings of the 2019 34th IEEE/ACM International Conference on Automated Software Engineering (ASE 2019) (San Diego, CA 10-15 November, 2019) p. 590-601
- Publisher Link
- http://dx.doi.org/10.1109/ASE.2019.00061
- Publisher
- Institute of Electrical and Electronics Engineers (IEEE)
- Resource Type
- conference paper
- Date
- 2019
- Description
- Developers often want to find out how to use a certain API (e.g., FileReader.read in JDK library). API usage examples are very helpful in this regard. Over the years, many automated methods have been proposed to generate code examples by clustering and summarizing relevant code snippets extracted from a code corpus. These approaches simplify source code as method invocation sequences or feature vectors. Such simplifications only model partial aspects of the code and tend to yield inaccurate examples. We propose CodeKernel, a graph kernel based approach to the selection of API usage examples. Instead of approximating source code as method invocation sequences or feature vectors, CodeKernel represents source code as object usage graphs. Then, it clusters graphs by embedding them into a continuous space using a graph kernel. Finally, it outputs code examples by selecting a representative graph from each cluster using designed ranking metrics. Our empirical evaluation shows that CodeKernel selects more accurate code examples than the related work (MUSE and eXoaDocs). A user study involving 25 developers in a multinational company also confirms the usefulness of CodeKernel in selecting API usage examples.
- Subject
- API usage example; graph kernel; code search; software reuse
- Identifier
- http://hdl.handle.net/1959.13/1474294
- Identifier
- uon:49257
- Identifier
- ISBN:9781728125084
- Language
- eng
- Reviewed
- Hits: 401
- Visitors: 401
- Downloads: 0
Thumbnail | File | Description | Size | Format |
---|